package com.yeci.utils;

import java.util.Random;

/**
 * @description: 生成随机盐的工具类
 * @author: yeci
 * @date: 2021/8/19 11:01
 **/
public class SaltUtil {
  public static String getSalt(int i){
    char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890!@#$%^&*()[];,./".toCharArray();
    StringBuilder sb = new StringBuilder();
    for(int n = 0; n < i; n++){
      char aChar = chars[new Random().nextInt(chars.length)];
      sb.append(aChar);
    }
    return sb.toString();
  }
}
